+Mon Nov 9 00:39:20 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkenums.h : new enum GtkCornerType
+ * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindow): added
+ window_placement.
+ * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_placement):
+ new method to set window_placement.
+ (gtk_scrolled_window_viewport_allocate)
+ (gtk_scrolled_window_size_allocate): few changes due to
+ window_placement.
+ * gtk/testgtk.c (remove_selection): fixed while loop.
+
Sat Nov 7 21:55:00 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/gtkclist.c: check if column[i].button is valid before calling
+Mon Nov 9 00:39:20 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkenums.h : new enum GtkCornerType
+ * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindow): added
+ window_placement.
+ * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_placement):
+ new method to set window_placement.
+ (gtk_scrolled_window_viewport_allocate)
+ (gtk_scrolled_window_size_allocate): few changes due to
+ window_placement.
+ * gtk/testgtk.c (remove_selection): fixed while loop.
+
Sat Nov 7 21:55:00 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/gtkclist.c: check if column[i].button is valid before calling
+Mon Nov 9 00:39:20 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkenums.h : new enum GtkCornerType
+ * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindow): added
+ window_placement.
+ * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_placement):
+ new method to set window_placement.
+ (gtk_scrolled_window_viewport_allocate)
+ (gtk_scrolled_window_size_allocate): few changes due to
+ window_placement.
+ * gtk/testgtk.c (remove_selection): fixed while loop.
+
Sat Nov 7 21:55:00 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/gtkclist.c: check if column[i].button is valid before calling
+Mon Nov 9 00:39:20 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkenums.h : new enum GtkCornerType
+ * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindow): added
+ window_placement.
+ * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_placement):
+ new method to set window_placement.
+ (gtk_scrolled_window_viewport_allocate)
+ (gtk_scrolled_window_size_allocate): few changes due to
+ window_placement.
+ * gtk/testgtk.c (remove_selection): fixed while loop.
+
Sat Nov 7 21:55:00 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/gtkclist.c: check if column[i].button is valid before calling
+Mon Nov 9 00:39:20 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkenums.h : new enum GtkCornerType
+ * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindow): added
+ window_placement.
+ * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_placement):
+ new method to set window_placement.
+ (gtk_scrolled_window_viewport_allocate)
+ (gtk_scrolled_window_size_allocate): few changes due to
+ window_placement.
+ * gtk/testgtk.c (remove_selection): fixed while loop.
+
Sat Nov 7 21:55:00 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/gtkclist.c: check if column[i].button is valid before calling
+Mon Nov 9 00:39:20 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkenums.h : new enum GtkCornerType
+ * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindow): added
+ window_placement.
+ * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_placement):
+ new method to set window_placement.
+ (gtk_scrolled_window_viewport_allocate)
+ (gtk_scrolled_window_size_allocate): few changes due to
+ window_placement.
+ * gtk/testgtk.c (remove_selection): fixed while loop.
+
Sat Nov 7 21:55:00 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/gtkclist.c: check if column[i].button is valid before calling
+Mon Nov 9 00:39:20 1998 Lars Hamann <lars@gtk.org>
+
+ * gtk/gtkenums.h : new enum GtkCornerType
+ * gtk/gtkscrolledwindow.h (struct _GtkScrolledWindow): added
+ window_placement.
+ * gtk/gtkscrolledwindow.c (gtk_scrolled_window_set_placement):
+ new method to set window_placement.
+ (gtk_scrolled_window_viewport_allocate)
+ (gtk_scrolled_window_size_allocate): few changes due to
+ window_placement.
+ * gtk/testgtk.c (remove_selection): fixed while loop.
+
Sat Nov 7 21:55:00 PST 1998 Manish Singh <yosh@gimp.org>
* gtk/gtkclist.c: check if column[i].button is valid before calling
GTK_ORIENTATION_VERTICAL
} GtkOrientation;
+/* Placement type for scrolled window */
+typedef enum
+{
+ GTK_CORNER_TOP_LEFT,
+ GTK_CORNER_BOTTOM_LEFT,
+ GTK_CORNER_TOP_RIGHT,
+ GTK_CORNER_BOTTOM_RIGHT
+} GtkCornerType;
+
/* Packing types (for boxes) */
typedef enum
{
scrolled_window->vscrollbar = NULL;
scrolled_window->hscrollbar_policy = GTK_POLICY_ALWAYS;
scrolled_window->vscrollbar_policy = GTK_POLICY_ALWAYS;
+ scrolled_window->window_placement = GTK_CORNER_TOP_LEFT;
scrolled_window->autogenerated_viewport = FALSE;
}
}
}
+void
+gtk_scrolled_window_set_placement (GtkScrolledWindow *scrolled_window,
+ GtkCornerType window_placement)
+{
+ g_return_if_fail (scrolled_window != NULL);
+ g_return_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window));
+
+ if (scrolled_window->window_placement != window_placement)
+ {
+ scrolled_window->window_placement = window_placement;
+
+ if (GTK_WIDGET (scrolled_window)->parent)
+ gtk_widget_queue_resize (GTK_WIDGET (scrolled_window));
+ }
+}
static void
gtk_scrolled_window_destroy (GtkObject *object)
gtk_widget_show (scrolled_window->hscrollbar);
child_allocation.x = viewport_allocation.x;
- child_allocation.y = viewport_allocation.y + viewport_allocation.height + SCROLLBAR_SPACING (scrolled_window);
+ if (scrolled_window->window_placement == GTK_CORNER_TOP_LEFT ||
+ scrolled_window->window_placement == GTK_CORNER_TOP_RIGHT)
+ child_allocation.y = (viewport_allocation.y +
+ viewport_allocation.height +
+ SCROLLBAR_SPACING (scrolled_window));
+ else
+ child_allocation.y = GTK_CONTAINER (scrolled_window)->border_width;
+
child_allocation.width = viewport_allocation.width;
child_allocation.height = scrolled_window->hscrollbar->requisition.height;
child_allocation.x += allocation->x;
gtk_widget_size_allocate (scrolled_window->hscrollbar, &child_allocation);
}
- else
- {
- if (GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
- gtk_widget_hide (scrolled_window->hscrollbar);
- }
+ else if (GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
+ gtk_widget_hide (scrolled_window->hscrollbar);
if (scrolled_window->vscrollbar_visible)
{
if (!GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
gtk_widget_show (scrolled_window->vscrollbar);
- child_allocation.x = viewport_allocation.x + viewport_allocation.width + SCROLLBAR_SPACING (scrolled_window);
+ if (scrolled_window->window_placement == GTK_CORNER_TOP_LEFT ||
+ scrolled_window->window_placement == GTK_CORNER_BOTTOM_LEFT)
+ child_allocation.x = (viewport_allocation.x +
+ viewport_allocation.width +
+ SCROLLBAR_SPACING (scrolled_window));
+ else
+ child_allocation.x = GTK_CONTAINER (scrolled_window)->border_width;
+
child_allocation.y = viewport_allocation.y;
child_allocation.width = scrolled_window->vscrollbar->requisition.width;
child_allocation.height = viewport_allocation.height;
gtk_widget_size_allocate (scrolled_window->vscrollbar, &child_allocation);
}
- else
- {
- if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
- gtk_widget_hide (scrolled_window->vscrollbar);
- }
+ else if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
+ gtk_widget_hide (scrolled_window->vscrollbar);
}
static void
GtkScrolledWindow *scrolled_window;
GtkArgInfo *info_hadj;
GtkArgInfo *info_vadj;
- GtkArg arg;
gchar *error;
g_return_if_fail (container != NULL);
allocation->height = MAX (1, widget->allocation.height - allocation->y * 2);
if (scrolled_window->vscrollbar_visible)
- allocation->width = MAX (1,
- allocation->width - (scrolled_window->vscrollbar->requisition.width + SCROLLBAR_SPACING (scrolled_window)));
+ {
+ if (scrolled_window->window_placement == GTK_CORNER_TOP_RIGHT ||
+ scrolled_window->window_placement == GTK_CORNER_BOTTOM_RIGHT)
+ allocation->x += (scrolled_window->vscrollbar->requisition.width +
+ SCROLLBAR_SPACING (scrolled_window));
+
+ allocation->width =
+ MAX (1, allocation->width -
+ (scrolled_window->vscrollbar->requisition.width +
+ SCROLLBAR_SPACING (scrolled_window)));
+ }
if (scrolled_window->hscrollbar_visible)
- allocation->height = MAX (1,
- allocation->height - (scrolled_window->hscrollbar->requisition.height + SCROLLBAR_SPACING (scrolled_window)));
+ {
+ if (scrolled_window->window_placement == GTK_CORNER_BOTTOM_LEFT ||
+ scrolled_window->window_placement == GTK_CORNER_BOTTOM_RIGHT)
+ allocation->y += (scrolled_window->hscrollbar->requisition.height +
+ SCROLLBAR_SPACING (scrolled_window));
+
+ allocation->height =
+ MAX (1, allocation->height -
+ (scrolled_window->hscrollbar->requisition.height +
+ SCROLLBAR_SPACING (scrolled_window)));
+ }
}
static void
guint vscrollbar_policy : 2;
guint hscrollbar_visible : 1;
guint vscrollbar_visible : 1;
+ guint window_placement : 2;
guint autogenerated_viewport : 1;
};
void gtk_scrolled_window_set_policy (GtkScrolledWindow *scrolled_window,
GtkPolicyType hscrollbar_policy,
GtkPolicyType vscrollbar_policy);
-
+void gtk_scrolled_window_set_placement (GtkScrolledWindow *scrolled_window,
+ GtkCornerType window_placement);
#ifdef __cplusplus
}
while (selection)
{
work = selection->data;
+ selection = selection->next;
+
if (GTK_CTREE_ROW (work)->is_leaf)
pages--;
else
}
gtk_ctree_remove_node (ctree, work);
- selection = GTK_CLIST (ctree)->selection;
}
if (new_sel)
pixmap1, mask1, pixmap2, mask2,
FALSE, FALSE);
- style = gtk_style_new();
+ style = gtk_style_new ();
switch (cur_depth % 3)
{
case 0:
while (selection)
{
work = selection->data;
+ selection = selection->next;
+
if (GTK_CTREE_ROW (work)->is_leaf)
pages--;
else
}
gtk_ctree_remove_node (ctree, work);
- selection = GTK_CLIST (ctree)->selection;
}
if (new_sel)
pixmap1, mask1, pixmap2, mask2,
FALSE, FALSE);
- style = gtk_style_new();
+ style = gtk_style_new ();
switch (cur_depth % 3)
{
case 0: